package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.SurveyQuestionVo;
import com.mk.admin.service.SurveyQuestionService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/surveyQuestion")
@Api(tags = "调查问卷问题")
public class SurveyQuestionController extends BaseController<SurveyQuestionVo> {
    @Autowired
    private SurveyQuestionService surveyQuestionService;

    @PostMapping("/select")
    @Override
    public ResultDto select(@RequestBody SurveyQuestionVo surveyQuestionVo) {
        return surveyQuestionService.select(surveyQuestionVo);
    }

    @PostMapping("/add")
    @Override
    public ResultDto add(@RequestBody SurveyQuestionVo surveyQuestionVo) {
        return surveyQuestionService.add(surveyQuestionVo);
    }

    @PostMapping("/update")
    @Override
    public ResultDto update(@RequestBody SurveyQuestionVo surveyQuestionVo) {
        return surveyQuestionService.update(surveyQuestionVo);
    }

    @PostMapping("/delete")
    @Override
    public ResultDto delete(@RequestBody SurveyQuestionVo surveyQuestionVo) {
        return surveyQuestionService.delete(surveyQuestionVo.getSurveyId());
    }

    @PostMapping("/status")
    @Override
    public ResultDto status(@RequestBody SurveyQuestionVo surveyQuestionVo) {
        return surveyQuestionService.status(surveyQuestionVo.getId());
    }
}
